﻿using System.Diagnostics;
using System.Windows;

namespace 迭代器模式
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            IList list = new ConcreteList();
            var iterator = list.GetIterator();
            while (iterator.MoveNext())
            {
                var i = (int)iterator.CurrentItem();
                Debug.WriteLine(i.ToString());
                iterator.Next();
            }
        }
    }
}
